<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex benben-position-layout flex flex-wrap align-center personalProfile_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
			>
				<view class='flex flex-wrap align-center justify-between flex-sub personalProfile_fd0_0'>
					<view
						class='flex flex-wrap align-center personalProfile_fd0_0_c0'
						@tap.stop="handleJumpDiy"
						data-type="back"
						data-url="1"
					>
						<text class='fu-iconfont2'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text
							class='personalProfile_fd0_0_c1_c0'
							style="font-family: Alimama DongFangDaKai, Alimama DongFangDaKai;"
						>修改个人简介</text>
					</view>
					<view class='flex flex-wrap align-center justify-end personalProfile_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>

			<view
				class="loading_css"
				v-if="isShow"
			>
				<u-loading
					size="36"
					color="#AD3823"
				></u-loading>
				<view>加载中</view>
			</view>

			<block v-else>
				<!---flex布局flex布局开始-->
				<view class="flex flex-direction align-stretch benben-flex-layout personalProfile_flex_1">
					<view class='flex flex-wrap align-center personalProfile_fd1_0'>
						<view class='flex flex-wrap personalProfile_fd1_0_c0'>
							<textarea
								class='flex personalProfile_input_fd1_0_c0'
								:placeholder="'有趣的简介可以吸引粉丝'"
								:maxlength="240"
								placeholder-style="color:#999;font-size:32rpx;font-family: Source Han Sans CN, Source Han Sans CN;"
								v-model="userInfo.profile"
							/>

						</view>
					</view>
				</view>

				<!---flex布局flex布局结束-->
				<view class="flex flex-wrap align-center justify-center benben-position-layout flex personalProfile_flex_2">
					<button
						class='personalProfile_fd2_0'
						style="font-family: Alimama DongFangDaKai;"
						@tap="editUserNiknameFunc()"
					>保存</button>

				</view>
			</block>

			<view :style="{height: '128rpx'}"></view>


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"fd1_0_c0": "",
				"userInfo": {
					"invite_code": "",
					"address": "",
					"address_code": "",
					"hobby": "",
					"tags": "",
					"id": "",
					"userlevel_id": "",
					"mobile": "",
					"real_name": "",
					"avatar": "",
					"account": "",
					"email": "",
					"birthday": "",
					"gender": "",
					"create_time": "",
					"user_money": "",
					"freeze_money": "",
					"total_consumption_money": "",
					"score": "",
					"_mobile": "",
					"coupon": "",
					"collection_count": "",
					"browse_count": "",
					"total_money": "",
					"certified": "",
					"nickname": "",
					"is_pay_password": "",
					"follow_count": "",
					"profile": ""
				},
				"newUserInfo": {
					"userinfo": {
						"id": "",
						"avatar": "",
						"real_name": "",
						"nickname": "",
						"email": "",
						"gender": "",
						"mobile": "",
						"birthday": "",
						"client_id": "",
						"phone": ""
					}
				},
				"editname": "editname"
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getUserInfoFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取用户信息
			async getUserInfoFunc() {
				//请求方法
				//数据验证

				let datauserInfo = await this.$api.get(global.apiUrls.post5c78c4772da97, {

				});
				this.isShow = false;
				if (datauserInfo.data.code != 1) {
					this.$message.info(datauserInfo.data.msg);
					return
				}
				let infouserInfo = datauserInfo.data;
				this.userInfo = infouserInfo.data
			},
			editUserNiknameFunc() {
				uni.$emit('chengeProfile', this.userInfo.profile);
				uni.navigateBack();
			},
			//修改用户信息
			// async editUserNiknameFunc() {
			// 	if (!validate(this.userInfo.profile, 'require')) {
			// 		this.$message.info('请输入个人简介');
			// 		return false;
			// 	}
			// 	//请求方法
			// 	//数据验证

			// 	let datanewUserInfo = await this.$api.post(global.apiUrls.post5cb54af125f1c, {
			// 		profile: this.userInfo.profile
			// 	});

			// 	if (datanewUserInfo.data.code != 1) {
			// 		this.$message.info(datanewUserInfo.data.msg);
			// 		return
			// 	}
			// 	let infonewUserInfo = datanewUserInfo.data;
			// 	this.newUserInfo = infonewUserInfo.data
			// 	this.$message.info(datanewUserInfo.data.msg);
			// 	uni.$emit('chengeProfile', this.userInfo.profile);
			// 	setTimeout(() => {
			// 		uni.navigateBack();
			// 	}, 800)
			// },
		}
	};
</script>
<style
	lang="scss"
	scoped
>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.guochaoxiaoju.com/uploads/mini/571.png) no-repeat;
		background-size: 100% auto;
	}

	.personalProfile_flex_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/571.png) no-repeat;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.personalProfile_fd0_0_c1_c0 {
		font-size: 40rpx;
		font-weight: 400;
		color: #333333;
		line-height: 88rpx;
	}

	.personalProfile_fd0_0_c0 {
		width: 120rpx;
	}

	.personalProfile_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.personalProfile_flex_1 {
		padding: 24rpx 30rpx 24rpx 30rpx;
	}

	.personalProfile_input_fd1_0_c0 {
		width: 100%;
		height: 140rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		white-space: pre-wrap;
	}

	.personalProfile_fd1_0_c0 {
		background: #F8F9FD;
		width: 690rpx;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		padding: 38rpx 36rpx 0rpx 36rpx;
		height: 454rpx;
	}

	.personalProfile_fd1_0 {
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		width: 690rpx;
		height: 454rpx;
	}

	.personalProfile_flex_2 {
		width: 750rpx;
		height: 128rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}

	.personalProfile_fd2_0 {
		background: var(--benbenbgColor2);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		width: 690rpx;
		line-height: 88rpx;
		font-size: 36rpx;
		color: #fff;
		height: 88rpx;
		margin: 0rpx 0rpx 40rpx 0rpx;
	}
</style>